ZK UI supports ZK Enterprise features.Just put the zk ee jar to libs
or put jar dependencies in grails-app/conf/BuildConfig.groovyYou can also install the Enterprise edition by
$ grails install-plugin zk-ee
This plugin contains addition jars required for enabling ZK Enterprise features.How to use
You can simply put theme jar in lib
directory.Or add dependencies in grails-app/conf/BuildConfig.groovy
First, add zkoss' maven Dependency Repositories
repositories {
…
mavenRepo "http://mavensync.zkoss.org/maven2/"
…
}
Second,specify dependencies
dependencies {
// there are three theme 'breeze', 'sapphire', 'silvertail'
def zkThemeVersion="5.0.9"
def zkTheme="breeze"
runtime "org.zkoss.theme:${zkTheme}:${zkThemeVersion}"
}
How to switch different themes dynamically
The default theme provider checks the current theme settings in order of preferences;First priority: Cookie
Set cookie zktheme=nameFor instance, write cookie zktheme=breeze, breeze theme will be activatedSecond priority: Library property
The default theme provider will obtain the current theme setting from library property if cookie is empty.
<library-property>
<name>org.zkoss.theme.preferred</name>
<value>name</value>
</library-property>
For example, the following code will activiate the breeze theme.
<library-property>
<name>org.zkoss.theme.preferred</name>
<value>breeze</value>
</library-property>
Third priority: System's default them
The default theme provider maintains a default theme. If theme provider can't find theme setting in cookie or library property, default theme will be activated.
Dynamically switch themes using cookie
Here are a list of cookie sample codes that you can choose from.
Breeze
Themes.setTheme(Executions.getCurrent(), "breeze")
Executions.sendRedirect(null)
Sapphire
Themes.setTheme(Executions.getCurrent(), "sapphire")
Executions.sendRedirect(null)
Silvertail
Themes.setTheme(Executions.getCurrent(), "silvertail")
Executions.sendRedirect(null)
Classic blue
Themes.setTheme(Executions.getCurrent(), "classicblue")
Executions.sendRedirect(null)
Dynamically switch themes using library property
Breeze
Library.setProperty("org.zkoss.theme.preferred", "breeze")
Executions.sendRedirect(null)
Sapphire
Library.setProperty("org.zkoss.theme.preferred", "sapphire")
Executions.sendRedirect(null)
Silvertail
Library.setProperty("org.zkoss.theme.preferred", "silvertail")
Executions.sendRedirect(null)
Classic blue
Library.setProperty("org.zkoss.theme.preferred", "classicblue")
Executions.sendRedirect(null)
Retrieve web app supported theme names
String names = Library.getProperty("org.zkoss.theme.names");
Reference
ZK Themes GetStartedYou can extends the org.grails.plugins.zkui.AbstractTagLib implement the Extensions Component's Taglib same as:import org.grails.plugins.zkui.AbstractTagLibclass CalendarsTagLib extends AbstractTagLib {
static namespace = "z" def calendars = { attrs, body ->
doTag(attrs, body, "calendars")
}}
and put the Calendar jar to lib